Returns the image scale used for OCR. Use when debugging OCR statements to see the scale used and determine if changes are needed to improve the accuracy of returned text. The scale is set in the playback options or by the OCRSetScale statement. See Troubleshooting OCR issues.
Syntax
OCRGetScale()
Return value
Value | Description |
---|---|
Value between 1 and 15 | Number of times larger than the original size images are scaled before they are read using OCR. For example, 1 indicates images are scaled to original size (100%) and 15 indicates images are scaled 15 times the original size (1500%). |
Example
'Saves default OCR settings
lang = OCRGetLanguageFilePath()
contrast = OCRGetContrast()
imgScale = OCRGetScale()
grayConversion = OCRIsConvertingToGrayscale()
Try
'Changes OCR settings for the checkpoint
OCRSetLanguageFilePath("C:\\tessdata\\MICR.traineddata")
OCRSetContrast(50)
OCRSetScale(2)
OCRConvertToGrayscale(True)
'Verifies text in the page footer
Window("ACME Bank").OCRCheckpoint(92, "ACME Bancorp, Member FDIC", 13, 4, 86, 11, False, "Footer text is incorrect")
Finally
'Resets default OCR settings
OCRSetLanguageFilePath(lang)
OCRSetContrast(contrast)
OCRSetScale(imgScale)
OCRConvertToGrayscale(grayConversion)
End Try